using System.Linq;
using System.Web.Mvc;
using Quickie.Models;
using Quickie.Models.IoC;
using Quickie.Models.Data;
using Quickie.Models.Entities;
using Quickie.Models.ViewModel;
using Quickie.Models.Interfaces;

namespace Quickie.Controllers
{
    [Authorize(Roles = "Administrator,Korisnik")]
    public class HomeController : Controller
    {
        private IRepository<Product> products;
        private IRepository<Category> category;
        private IRepository<Company> company;

        public HomeController(IRepository<Product> products, IRepository<Category> category, IRepository<Company> company)
        {
            this.products = products;
            this.category = category;
            this.company = company;
        }

        public ActionResult Index()
        {
            var categories = category.GetAll().ToList();
            var companies = company.GetAll().ToList();
         
            ViewData["cat"] = categories;
            ViewData["comp"] = companies;
            
            return View();
        }

    }
}
